package me.zxk.qwert_poetry.service;

import aj.org.objectweb.asm.commons.Remapper;
import me.zxk.qwert_poetry.dao.Poem;
import me.zxk.qwert_poetry.dao.Tag;
import me.zxk.qwert_poetry.dto.PoemDTO;
import org.springframework.data.domain.Page;

import java.util.List;

public interface PoemService {
    Poem getPoemById(int id);
    Poem addPoem(PoemDTO poem);
    Poem editPoem(PoemDTO poem);
    boolean deletePoem(int id);
    Page<Poem> listPoems(int page, int size);

    Page<Poem> searchPoemsByKeyword(String keyword, int page, int size);
    Page<Poem> searchPoemsByTag(Tag tag, int page, int size);
    Page<Poem> searchPoemsByTag(int tag, int page, int size);

    boolean likePoem(int poemId, int userId, boolean liked);

    List<Poem> listPoemsByIds(List<Integer> poemIds);

    Integer getLikeCountById(int id);
    Integer getCollectCountById(int id);

    Page<Poem> listPoemsByAuthorId(int authorId, int page, int size);

    Poem getRandomPoem();

    Boolean isLiked(int poemId, int userId);

    Boolean isCollected(int poemId, int userId);
}
